Skip to content

fix: make all four demos runnable end-to-end against the real cMCP Runtime#11

Merged
imran-siddique merged 1 commit into
feat/complete-examplesfrom
fix/runnable-demos
Jun 11, 2026
Merged

fix: make all four demos runnable end-to-end against the real cMCP Runtime#11
imran-siddique merged 1 commit into
feat/complete-examplesfrom
fix/runnable-demos

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

Summary

Today's codebase review found the demos could not run: Cedar policies failed to parse (nonexistent advice {} clause -> every call denied), policy scopes never matched the runtime's actual Cedar requests, catalogs failed schema validation at startup, and agents called endpoints (GET /trace, cmcp-verify) that do not exist. This PR makes all four demos runnable end-to-end -- verified by actually running each one locally against cmcp with PRs agentrust-io/cmcp#278-#282.

What changed

  • Cedar policies: valid Cedar with @annotation advice metadata, real action names (Action::"Ehr.treatmentPlanWriter"), context.arguments.* conditions. Verified with cedarpy: every decision and annotation payload matches the README narrative.
  • Catalogs: removed sensitivity_level: "internal" (not in the schema enum -- runtime exited at startup); finance.document_reader domain corrected hipaa_phi -> mnpi.
  • Agents: real API -- _cmcp metadata (session_id, would_have_denied, advice), error.data.advice on 403s, POST /sessions/{id}/close to obtain the signed RuntimeClaim.
  • Mock MCP servers: stdlib-only server/mock_mcp_server.py per example; demos run with zero external dependencies.
  • acme-corp runs enforcement_mode: advisory -- the advisory-vs-enforcing tenant contrast is now real (per-rule advisory was never a thing).
  • trace-output/ files are captured from real runs (signed claims, real audit chain hashes).
  • READMEs: 3-terminal flow, run from inside the example dir (config paths resolve relative to CWD, not the config file), real expected outputs.

Verified locally

  • healthcare: happy path 3/3 allow; --trigger-hitl denies with eu-ai-act-art-14 advice
  • financial-services: 250k allow; --amount-eur 750000 denies with mifid-ii-art-25 advice
  • multi-tenant-saas: acme advisory_deny-but-allowed with GDPR advice; globex hard-denies export + config with advice
  • startup-tpm: echo + signed TRACE claim

Depends on agentrust-io/cmcp#278, #279, #280, #282 (wiring, Cedar advice, upstream forwarding, session close). Stacked on #10.

Generated with Claude Code

…ntime

Verified by running every demo locally against cmcp (with upstream
forwarding, Cedar advice, and session close): all decisions and advice
payloads match the README narratives, and every trace-output/ file is now
captured from a real run.

- Cedar policies: rewritten in valid Cedar. The previous files used a
  nonexistent `advice {...}` clause (parse error -> every call denied) and
  matched on Action::"tool_call" / Tool::"..." scopes the runtime never
  sends. Rules now match real action names (Action::"Ehr.treatmentPlanWriter"),
  read arguments via context.arguments.*, and carry @annotations that the
  runtime returns as structured advice on denies.
- Catalogs: sensitivity_level "internal" is not in the schema enum (runtime
  exited at startup); replaced with valid values. financial document_reader
  compliance_domain corrected from hipaa_phi to mnpi.
- Agents: use the real API -- _cmcp metadata (session_id, would_have_denied,
  advice), error.data.advice on 403s, and POST /sessions/{id}/close to obtain
  the signed RuntimeClaim. Removed calls to GET /trace and cmcp-verify,
  neither of which exists.
- Mock MCP servers: each example ships a stdlib-only server/mock_mcp_server.py
  serving its catalog tools on :8080, so demos run with zero external deps.
- acme-corp tenant now runs enforcement_mode: advisory, making the
  advisory-vs-enforcing tenant contrast real (was impossible per-rule).
- READMEs: 3-terminal flow, run from inside the example dir (config paths
  resolve relative to CWD), real expected outputs, real TRACE record shape.
- financial agent: escalation now triggered via --amount-eur 750000 instead
  of editing source.

Requires cmcp PRs #278-#282 (wiring, advice, forwarding, session close).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@imran-siddique imran-siddique merged commit 59107aa into feat/complete-examples Jun 11, 2026
1 check passed
imran-siddique added a commit that referenced this pull request Jun 12, 2026
PRs #11, #13, and #14 were stacked on #10. When #10 squash-merged and its
branch was deleted, GitHub closed/merged the rest of the stack into the
deleted feature branches, so their content never reached main: financial
and healthcare shipped the unparseable advice{} Cedar policies, agents
called endpoints that do not exist, the mock servers and the cmcp verify
tamper demo were missing.

This restores the verified stack tip for the four original examples plus
.gitignore, with em dashes scrubbed per repo style, and merges the root
README: corrected table and 3-terminal quickstart from the stack, plus the
industrial-embodied-ai row with the #18 wording.

Verified before commit: all Cedar bundles parse and produce the documented
decisions (workflow-scoped allow, escalation/HITL deny, default deny), and
all catalog entries validate against the cmcp schema.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant